| API Documentation |  |

- MAIN PAGE
- NAMESPACES
- CLASSES

Public Member Functions | List of all members
nkWinUi::FontManager Class Referencefinal

Manages the recorded fonts [WIP]. More...

Inheritance diagram for nkWinUi::FontManager:

## Public Member Functions
Font * | getDefaultFont () const
System * | getSystem () const
Font * | createOrRetrieve (nkMemory::StringView name)
Font * | record (nkMemory::StringView name, nkMemory::UniquePtr< Font > resource)
Font * | get (nkMemory::StringView name) const
Font * | getByIndex (unsigned int index) const
void | rename (nkMemory::StringView oldName, nkMemory::StringView newName)
void | erase (nkMemory::StringView name)
nkMemory::UniquePtr< Font > | relinquish (nkMemory::StringView name)

## Detailed Description

Manages the recorded fonts [WIP].

This is a WIP.

## Member Function Documentation

## ◆ getDefaultFont()

Font* nkWinUi::FontManager::getDefaultFont | ( |  | ) | const

Returns
  The default font set.

## ◆ getSystem()

System* nkWinUi::FontManager::getSystem | ( |  | ) | const

Returns
  The system the manager is living in.

## ◆ createOrRetrieve()

Font* nkWinUi::FontManager::createOrRetrieve | ( | nkMemory::StringView | name | ) |

Creates if unavailable, or retrieves if available, a font.

Parameters

  name | The name of the font to retrieve.

Returns
  The font requested, possibly freshly created. The manager owns the memory returned, external code should never delete it. See erase(), or relinquish().

## ◆ record()

Font* nkWinUi::FontManager::record | ( | nkMemory::StringView | name,
|  | nkMemory::UniquePtr< Font > | resource
| ) |  |

Records an already existing resource in the manager, passing its ownership around.

Parameters

  name | The name under which the resource should be recorded.
  resource | The resource to record.

Returns
  A raw pointer over the resource, now recorded in the manager.

## ◆ get()

Font* nkWinUi::FontManager::get | ( | nkMemory::StringView | name | ) | const

Retrieves a font.

Parameters

  name | The name of the font to retrieve.

Returns
  The font requested if available, nullptr else.

## ◆ getByIndex()

Font* nkWinUi::FontManager::getByIndex | ( | unsigned int | index | ) | const

Get a font, by index. Note that one index can map to a different font after memory is changed. Useful to loop over all available fonts in one go.

Parameters

  index | The index of the font to retrieve.

Returns
  The font linked if available, nullptr else.

## ◆ rename()

void nkWinUi::FontManager::rename | ( | nkMemory::StringView | oldName,
|  | nkMemory::StringView | newName
| ) |  |

Renames a font.

Parameters

  oldName | The name of the font to rename.
  newName | The name to reassign to the font.

## ◆ erase()

void nkWinUi::FontManager::erase | ( | nkMemory::StringView | name | ) |

Erases and frees a font.

Parameters

  name | The name of the font to erase.

## ◆ relinquish()

nkMemory::UniquePtr<Font> nkWinUi::FontManager::relinquish | ( | nkMemory::StringView | name | ) |

Requests the manager to relinquish the ownership of a resource and pass it around.

Parameters

  name | The name of the recorded resource to relinquish.

Returns
  The ownership over the resource requested if available, nullptr otherwise.

The documentation for this class was generated from the following file:

- Documentation/Headers/NilkinsWinUi/Fonts/FontManager.h